package com.utility.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.utility.project.common.base.R;
import com.utility.project.entity.YsExam;
import com.utility.project.entity.YsPaper;
import com.utility.project.param.ExamParam;
import com.utility.project.param.PaperParam;
import com.utility.project.service.IYsPaperService;
import com.utility.project.vo.YasiPaperVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author yangzhiguo
 * @date 2024-06-22
 * @description 试卷
 */
@Api(tags = "试卷")
@RestController
@RequestMapping("/ysPaper")
public class YsPaperController {

    @Resource
    private IYsPaperService ysPaperService;

    @ApiOperation("通过ID查询试卷数据")
    @GetMapping("/queryById")
    public R queryById(@RequestParam("id")Long id){
        return R.ok(ysPaperService.getById(id));
    }

    @ApiOperation("查询口语和写作paper列表")
    @PostMapping("/queryPaperList")
    public R queryPaperList(@RequestBody PaperParam param){
        IPage<YsPaper> paperDtoList = ysPaperService.queryPaperList(param);
        return R.ok(paperDtoList);
    }


    
}
